Data may be stored in a structured data format, such as in a database, and/or data may be stored as unstructured data, for example, in files and folders in a digital file system. Some file systems may be a distributed file system and may have a disk-based data storage in the backend. Typically, a disk-based file system has an architecture where the storage layer that performs the operations for storing and retrieving the data uses file names and directory names on the disk-based backend. The distributed file system can access data, which is a file or a directory, by using a path (e.g., file path) to the data on the disk-based backend.
Some file systems may be implemented in the kernel space and some file systems may be implemented in a user space. Generally, file systems that are implemented in the user space may be restricted to perform file access operations on files in the file system using the file name and the file path. When a file is created in a file system, some file systems generate a file handle for the file. A file handle is a file identifier that is independent of the file name and can be used to access the file. Clients, such as NFS (network file system) clients, can store the file handle and can use the file handle for subsequent requests to access a file. The NFS client communicates with an NFS server regarding file access requests, and the NFS server further communicates with the storage subsystem in the file system regarding file access requests. Generally, at the storage level, the storage subsystem uses a file descriptor for the file to perform an operation (e.g., open file operation), rather than using a file handle. A file descriptor is an index for an entry in a kernel-resident data structure containing the details of the open files. In POSIX (portable operating system interface), the data structure may be called a file descriptor table. Generally, the NFS server does not have read/write access to the file descriptor table that includes the file descriptors for the open files. Typically, the file descriptors are assigned by the kernel, and the kernel records the assignment in the file descriptor table.
Traditionally, when the NFS server receives a file handle from the NFS client, the NFS server has to request that the file be opened in order for the kernel to assign a file descriptor to the file. Conventionally, the NFS server makes a system call, using the network RPC (remote procedure calls) protocol to request the kernel to open the file. In response to the system call, the kernel would open the file, make the file descriptor assignment for the file, and return the file descriptor to the NFS server. The NFS storage server would then use the file descriptor, which was returned from the kernel, to issue a read call to the storage subsystem to perform a read operation on the file. When the read operation is complete, the NFS storage server would issue a close call. Generally, the system calls (e.g., open) made by the NFS storage server are costly in that the calls add networking delay, and take greater time to process because the calls are made by the NFS storage server using the network RPC protocol.